
#include <fmt/format.h>
#include <iostream>
#include <ostream>
#include <vector>
#include <ranges>

void showResult(int value, size_t size, size_t capacity)
{
    std::cout << fmt::format("appended:{};size:{};capacity:{}\n", value, size, capacity);
}
int main()
{
    std::vector<int> integers{};
    std::cout << "size of intergers: " << integers.size() << "\nCapacity of intergers: " << integers.capacity() << "\n\n";

    for (int i : std::views::iota(1, 11))
    {
        integers.push_back(i);
        showResult(i, integers.size(), integers.capacity());
    }
    std::cout << "\n";

    std::cout << "Output intergers using iterators: ";
    for (auto constIterator{ integers.cbegin() }; constIterator != integers.cend(); ++constIterator)
    {
        std::cout << *constIterator << " ";
    }
    std::cout << "\n";

    std::cout << "Output intergers in reverse using iterators: ";
    for (auto reverseIterator{ integers.crbegin() }; reverseIterator != integers.crend(); ++reverseIterator)
    {
        std::cout << *reverseIterator << " ";
    }
    std::cout << "\n";
    return 0;
}